package org.webflux.remote.client.factoryBean;

import org.springframework.beans.factory.FactoryBean;
import org.webflux.remote.client.proxy.JdkDynamicAopProxy;
import org.webflux.remote.client.proxy.ProxyCreator;

public class FeignWebFluxClientFactoryBean implements FactoryBean<Object> {
    private Class<?> type; // 接口类型
    @Override
    public Object getObject() throws Exception {
        ProxyCreator proxyCreator = new JdkDynamicAopProxy();
        return proxyCreator.createProxy(type);
    }

    @Override
    public Class<?> getObjectType() {
        return type;
    }

    // setter方法（Spring会自动注入配置的属性）
    public void setType(Class<?> type) {
        this.type = type;
    }

}
